#ifndef __common__h__
#define __common__h__

//important for mouse grabbing
#define GRABABLE_MASK_BIT (1<<31) 
#define NOT_GRABABLE_MASK (~GRABABLE_MASK_BIT)

#define printx(x) \
	cout << x << endl;

#define safe_exit(msg, cond) \
    if (cond) \
	{ \
	    cout << msg << endl; \
	    system("pause");\
	    exit(-1); \
    }

#define xml_get_attrib_int(node, attrib_name) \
    tool::get_instance()->str_to_int(node.attribute(attrib_name).value());

#define xml_get_attrib_float(node, attrib_name) \
	tool::get_instance()->str_to_float(node.attribute(attrib_name).value());

#define xml_get_attrib_pchar(node, attrib_name) \
	(char*)(node.attribute(attrib_name).value());

#define xml_get_attrib_int_pair(node, attrib_name) \
	tool::get_instance()->str_to_int_pair((char*)(node.attribute(attrib_name).value()));

#define xml_get_attrib_float_pair(node, attrib_name) \
	tool::get_instance()->str_to_float_pair((char*)(node.attribute(attrib_name).value()));


struct int_pair
{
	int x;
	int y;

	int_pair(){}
	int_pair(int _x, int _y){x=_x; y=_y;}
};

struct float_pair
{
	float x;
	float y;
};

#endif